{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ac08e9ab",
   "metadata": {},
   "outputs": [],
   "source": [
    "print('二、数字猜谜游戏')\n",
    "print('数字猜谜游戏！')\n",
    "\n",
    "a = 1\n",
    "i = 0\n",
    "while a != 20:\n",
    "   a = int (input ('请输入你猜的数字：'))\n",
    "   i += 1    \n",
    "   if a == 20:\n",
    "      if i<3:\n",
    "         print('真厉害，这么快就猜对了！')\n",
    "      else :\n",
    "         print('总算猜对了，恭喜恭喜！')\n",
    "   elif a < 20:\n",
    "      print('你猜的数字小了，别灰心，再试一次！')\n",
    "   else :\n",
    "      print('你猜的数字大了，别灰心，继续加油！')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "874d3a96",
   "metadata": {},
   "outputs": [],
   "source": [
    "z"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "88701abf",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a3d6165c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5f563352",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cc5b344d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "069a554c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bd0b3df6",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
